package org.fixies.sample;

import java.math.BigDecimal;

public final class Calc {
    private static final BigDecimal TAX_RATE = new BigDecimal("0.05");

    public static int calcConsumptionTax(int orig) {
        if (orig < 0) {
            throw new IllegalArgumentException("argument must not be negative");
        } else if (orig > 10000) {
            throw new IllegalArgumentException("argument is too big");
        }
        return new BigDecimal(orig).multiply(TAX_RATE).intValue();
    }
    private Calc() {
    }
}
